package http

import (
	"github.com/gin-gonic/gin"
	"go-api-template/service"
	"golang.org/x/sync/singleflight"
)

// RequesterI 请求接口
type RequesterI interface {
	Request(ctx *gin.Context, s *service.Service) (Resp, error)
}

// BinderI 自定义参数校验接口
type BinderI interface {
	Bind(ctx *gin.Context) error
}

// PathCacheI 路径缓存接口
type PathCacheI interface {
	Cache(key string, ctx *gin.Context, s *service.Service, sg *singleflight.Group) (Resp, error)
}

// UserCacheI 用户缓存接口
type UserCacheI interface {
	UserCache(key string, ctx *gin.Context, s *service.Service, sg *singleflight.Group) (Resp, error)
}

// CustomReturnI 自定义返回接口
type CustomReturnI interface {
	Return(ctx *gin.Context, resp interface{}, code int)
}

// MqDoI 发送至MQ服务器预处理接口
type MqDoI interface {
	PushMq(*service.Service, string)
}
